1. Field of the Invention
The present invention relates to a moving picture coding system, and more particularly to a prediction motion vector calculation method by defining a motion vector to be used in a median operation when a neighboring block around a block to be coded has a plurality of motion vectors, so as to obtain a prediction motion vector (PMV) of the block to be coded; using motion vector information of neighboring blocks, and improve a coding efficiency.
2. Description of the Related Art
Generally, in order to reduce the amount of bits to be used for the transfer of motion information, an encoder, instead of sending a motion vector MV directly to a decoder, selects a median value of motion vectors of three neighboring blocks through a median operation, determines the selected median value as a prediction motion vector PMV, obtains a difference MVD between the MV and the PMV (i.e., MVD=MV−PMV), and sends the obtained difference MVD to the decoder.
Then, the decoder obtains the motion vector MV by obtaining the prediction motion vector PMV in the same manner as the encoder and adding the sent MVD to the obtained PMV. In FIG. 1, a block E is a block to be coded (or decoded), and blocks A, B and C are neighboring blocks of the block E. Defining motion vectors of the neighboring blocks A, B and C, respectively, as MVA, MVB and MVC, a prediction motion vector PMV of the block E can be obtained through a median operation as follows:PMV=median{MVA,MVB,MVC}
A block D in FIG. 1 is a block which is used instead of the block C when the block C exists outside of a picture. Provided that only one of the three blocks A, B and C, or A, B and D refers to the same reference picture as that referred to by the block E, a motion vector MV of that block will be used as the prediction motion vector PMV. This motion information sending method is, applied to all pictures irrespective of their types.
On the other hand, a B picture has five types of predictive modes such as forward mode, backward mode, bi-predictive mode, direct mode and intra mode. Generally, a neighboring block in the forward mode has one motion vector MVFW obtained from a forward reference picture with an index ref_idx_fwd, and a neighboring block in the backward mode has one motion vector MVBW obtained from a backward reference picture with an index ref_idx_bwd.
In the bi-predictive mode of the B picture, the prediction is allowed from different directions and the same directions, such as forward/forward, backward/backward, and forward/backward. Each reference picture uses the index ref_idx_fwd or ref_idx_bwd regardless of its direction (forward or backward), and each motion vector is also represented as MVFW or MVBW regardless of its direction (The reason is that the predefined syntaxes' are used as they are. For expression of the syntaxes, ‘ref_idx—10’ or ‘ref_idx—11’ may be used for each index and ‘mv_list0’ or ‘mv_list1’ may be used for each motion vector.). The direct mode of the B picture is a predictive mode where motion information is not sent to the decoder and motion vectors MVf and MVb and reference pictures are derived from the inside of the decoder. The fact that the derived motion vectors are represented as MVf and MVb irrespective of their directions is the same as that in the bi-predictive mode.
In a conventional method for calculating a prediction motion vector PMV of the B picture, a forward prediction motion vector of the block E is obtained by extracting only forward motion vectors of the neighboring blocks and performing a median operation with respect to the extracted forward motion vectors. If one of the neighboring blocks has no forward motion vector, its motion vector is set to 0 and the median operation is performed under such a condition. This method is similarly applied to a backward prediction motion vector of the block E, so as to use only backward motion vectors of the neighboring blocks. If one of the neighboring blocks is in the intra mode, its motion vector is set to 0, the neighboring block is considered to refer to a reference picture different from that referred to by the block E, and the prediction motion vector PMV is obtained under such a condition.
However, as stated above, in the bi-predictive mode of the B picture, the prediction is allowed from different directions and the same directions, such as forward/forward, backward/backward, and forward/backward, each reference picture uses the index ref_idx_fwd or ref_idx_bwd regardless of its direction (forward or backward), and each motion vector is also represented as MVFW or MVBW regardless of its direction. As a result, there is a need to define a method for calculating a prediction motion vector PMV when a neighboring block having two motion vectors exists.
Provided that a neighboring block is in the bi-predictive mode (or the direct mode), motion vectors MVFW and MVBW (or MVf and MVb) thereof may have the same directions such as forward/forward or backward/backward, or different directions such as forward/backward. This direction information of the motion vectors cannot be determined from only the motion vector syntaxes ‘MVFW’ and ‘MVBW’ or the reference picture indexes ‘ref_idx_fwd’ and ‘ref_idx_bwd’. The conventional method for calculating the PMV of the B picture gives no accurate description of such a problem, resulting in great confusion.
For example, in the case where a neighboring block is in the bi-predictive mode having two motion vectors in the forward/forward directions, the conventional PMV calculation method gives no clearly defined determination as to whether both or any one of the two motion vectors must be used for the calculation of the forward prediction motion vector PMV of the block E.